package statistics

type StatisticsModel struct {
	ID      int    `gorm:"column:id" json:"id"`            //
	DateStr string `gorm:"column:date_str" json:"dateStr"` // 日期

	CountCreate         int64 `gorm:"column:count_create" json:"countCreate"`
	CountEnd            int64 `gorm:"column:count_end" json:"countEnd"`
	CountComplete       int64 `gorm:"column:count_complete" json:"countComplete"`
	CountCompleteNodraw int64 `gorm:"column:count_complete_nodraw" json:"countCompleteNodraw"`
	CountCancel         int64 `gorm:"column:count_cancel" json:"countCancel"`
	CountCancelNodraw   int64 `gorm:"column:count_cancel_nodraw" json:"countCancelNodraw"`
	CountSy             int64 `gorm:"column:count_sy" json:"countSy"`
	CountPlace          int64 `gorm:"column:count_place" json:"countPlace"` // 产生订单的门店数
	CountDevice         int64 `gorm:"column:count_device" json:"countDevice"`
	CountAlldraw        int64 `gorm:"column:count_alldraw" json:"countAlldraw"`
	CountDraw           int64 `gorm:"column:count_draw" json:"countDraw"`
	CountNodraw         int64 `gorm:"column:count_nodraw" json:"countNodraw"`
	CountSmalldraw      int64 `gorm:"column:count_smalldraw" json:"countSmalldraw"`
	CountPost           int64 `gorm:"column:count_post" json:"countPost"`
	CountDepost         int64 `gorm:"column:count_depost" json:"countDepost"`
	CountWx             int64 `gorm:"column:count_wx" json:"countWx"`
	CountZfb            int64 `gorm:"column:count_zfb" json:"countZfb"`

	SettlementTotal        int64 `gorm:"column:settlement_total" json:"settlementTotal"`
	SettlementNormalTotal  int64 `gorm:"column:settlement_normal_total" json:"settlementNormalTotal"`
	SettlementComplete     int64 `gorm:"column:settlement_complete" json:"settlementComplete"`
	SettlementCancel       int64 `gorm:"column:settlement_cancel" json:"settlementCancel"`
	SettlementCancelNodraw int64 `gorm:"column:settlement_cancel_nodraw" json:"settlementCancelNodraw"`
	SettlementAlldraw      int64 `gorm:"column:settlement_alldraw" json:"settlementAlldraw"`
	SettlementDraw         int64 `gorm:"column:settlement_draw" json:"settlementDraw"`
	SettlementNodraw       int64 `gorm:"column:settlement_nodraw" json:"settlementNodraw"`
	SettlementSmalldraw    int64 `gorm:"column:settlement_smalldraw" json:"settlementSmalldraw"`
	SettlementPost         int64 `gorm:"column:settlement_post" json:"settlementPost"`
	SettlementDepost       int64 `gorm:"column:settlement_depost" json:"settlementDepost"`
	SettlementWx           int64 `gorm:"column:settlement_wx" json:"settlementWx"`
	SettlementZfb          int64 `gorm:"column:settlement_zfb" json:"settlementZfb"`

	IncomeTotal    int64 `gorm:"column:income_total" json:"incomeTotal"`
	IncomeBusiness int64 `gorm:"column:income_business" json:"incomeBusiness"`
	IncomeBranch   int64 `gorm:"column:income_branch" json:"incomeBranch"`

	WeixinTotal        int64 `gorm:"column:weixin_total" json:"weixinTotal"`                // 企业付款至零钱  笔数
	WeixinMoney        int64 `gorm:"column:weixin_money" json:"weixinMoney"`                // 企业付款至零钱  金额
	QrcodeTotal        int64 `gorm:"column:qrcode_total" json:"qrcodeTotal"`                // 收款二维码 发起笔数
	QrcodeWaitTotal    int64 `gorm:"column:qrcode_wait_total" json:"qrcodeWaitTotal"`       // 收款二维码 待处理笔数
	QrcodeSuccessTotal int64 `gorm:"column:qrcode_success_total" json:"qrcodeSuccessTotal"` // 收款二维码 已处理笔数
	QrcodeWaitMoney    int64 `gorm:"column:qrcode_wait_money" json:"qrcodeWaitMoney"`       // 收款二维码 待处理金额
	QrcodeSuccessMoney int64 `gorm:"column:qrcode_success_money" json:"qrcodeSuccessMoney"` // 收款二维码 已处理金额
	CashFailedTotal    int64 `gorm:"column:cash_failed_total" json:"cashFailedTotal"`       // 处理失败笔数
	CashFailedMoney    int64 `gorm:"column:cash_failed_money" json:"cashFailedMoney"`       // 处理失败金额

	Places  int64 `gorm:"column:places" json:"places"`
	Devices int64 `gorm:"column:devices" json:"devices"`

	WxUv     int   `gorm:"column:wx_uv" json:"wxUv"`
	WxNewUv  int   `gorm:"column:wx_new_uv" json:"wxNewUv"`
	ZfbUv    int   `gorm:"column:zfb_uv" json:"zfbUv"`
	ZfbNewUv int   `gorm:"column:zfb_new_uv" json:"zfbNewUv"`
	WxAd     int64 `gorm:"column:wx_ad" json:"wxAd"`
	ZfbAd    int64 `gorm:"column:zfb_ad" json:"zfbAd"`
	WxKs     int   `gorm:"column:wx_ks" json:"wxKs"`

	ScanPv int64 `gorm:"column:pv_count" json:"pvCount"`
	ScanUv int64 `gorm:"column:uv_count" json:"uvCount"`
}

type StatisticsUserModel struct {
	ID      int    `gorm:"column:id" json:"id"`            //
	DateStr string `gorm:"column:date_str" json:"dateStr"` // 日期

	UserId              int64 `gorm:"column:user_id" json:"userId"`
	TotalTeam           int   `gorm:"column:total_team" json:"totalTeam"`
	TotalPlace          int   `gorm:"column:total_place" json:"totalPlace"`
	TotalDirectTeam     int   `gorm:"column:total_direct_team" json:"totalDirectTeam"`
	TotalDirectPlace    int   `gorm:"column:total_direct_place" json:"totalDirectPlace"`
	TotalDevices        int64 `gorm:"column:total_devices" json:"totalDevices"`
	TotalOrders         int64 `gorm:"column:total_orders" json:"totalOrders"`
	TotalComplete       int64 `gorm:"column:total_complete" json:"totalComplete"`
	TotalCompleteNodraw int64 `gorm:"column:total_complete_nodraw" json:"totalCompleteNodraw"`
	TotalCancel         int64 `gorm:"column:total_cancel" json:"totalCancel"`
	TotalCancelNodraw   int64 `gorm:"column:total_cancel_nodraw" json:"totalCancelNodraw"`
	TotalSy             int64 `gorm:"column:total_sy" json:"totalSy"`
	TotalAllDraw        int64 `gorm:"column:total_alldraw" json:"totalAlldraw"`
	TotalDraw           int64 `gorm:"column:total_draw" json:"totalDraw"`
	TotalNodraw         int64 `gorm:"column:total_nodraw" json:"totalNodraw"`
	TotalSmalldraw      int64 `gorm:"column:total_smalldraw" json:"totalSmalldraw"`
	TotalIncome         int64 `gorm:"column:total_income" json:"totalIncome"`

	PlaceSales int64 `gorm:"column:place_sale" json:"placeSales"` // 门店动销数

	SettlementTotal        int64 `gorm:"column:settlement_total" json:"settlementTotal"`
	SettlementNormalTotal  int64 `gorm:"column:settlement_normal_total" json:"settlementNormalTotal"`
	SettlementComplete     int64 `gorm:"column:settlement_complete" json:"settlementComplete"`
	SettlementCancel       int64 `gorm:"column:settlement_cancel" json:"settlementCancel"`
	SettlementCancelNodraw int64 `gorm:"column:settlement_cancel_nodraw" json:"settlementCancelNodraw"`
	SettlementAlldraw      int64 `gorm:"column:settlement_alldraw" json:"settlementAlldraw"`
	SettlementDraw         int64 `gorm:"column:settlement_draw" json:"settlementDraw"`
	SettlementNodraw       int64 `gorm:"column:settlement_nodraw" json:"settlementNodraw"`
	SettlementSmalldraw    int64 `gorm:"column:settlement_smalldraw" json:"settlementSmalldraw"`

	BranchPlaces int `gorm:"column:branch_places" json:"branchPlaces"`

	WeixinTotal        int64 `gorm:"column:weixin_total" json:"weixinTotal"`                // 企业付款至零钱  笔数
	WeixinMoney        int64 `gorm:"column:weixin_money" json:"weixinMoney"`                // 企业付款至零钱  金额
	QrcodeTotal        int64 `gorm:"column:qrcode_total" json:"qrcodeTotal"`                // 收款二维码 发起笔数
	QrcodeWaitTotal    int64 `gorm:"column:qrcode_wait_total" json:"qrcodeWaitTotal"`       // 收款二维码 待处理笔数
	QrcodeSuccessTotal int64 `gorm:"column:qrcode_success_total" json:"qrcodeSuccessTotal"` // 收款二维码 已处理笔数
	QrcodeWaitMoney    int64 `gorm:"column:qrcode_wait_money" json:"qrcodeWaitMoney"`       // 收款二维码 待处理金额
	QrcodeSuccessMoney int64 `gorm:"column:qrcode_success_money" json:"qrcodeSuccessMoney"` // 收款二维码 已处理金额
	CashFailedTotal    int64 `gorm:"column:cash_failed_total" json:"cashFailedTotal"`       // 处理失败笔数
	CashFailedMoney    int64 `gorm:"column:cash_failed_money" json:"cashFailedMoney"`       // 处理失败金额
}

type StatisticsPlaceUserModel struct {
	ID      int    `gorm:"column:id" json:"id"`            //
	DateStr string `gorm:"column:date_str" json:"dateStr"` // 日期

	UserId              int64 `gorm:"column:user_id" json:"userId"`
	TotalTeam           int   `gorm:"column:total_team" json:"totalTeam"`
	TotalPlace          int   `gorm:"column:total_place" json:"totalPlace"`
	TotalDirectTeam     int   `gorm:"column:total_direct_team" json:"totalDirectTeam"`
	TotalDirectPlace    int   `gorm:"column:total_direct_place" json:"totalDirectPlace"`
	TotalDevices        int64 `gorm:"column:total_devices" json:"totalDevices"`
	TotalOrders         int64 `gorm:"column:total_orders" json:"totalOrders"`
	TotalComplete       int64 `gorm:"column:total_complete" json:"totalComplete"`
	TotalCompleteNodraw int64 `gorm:"column:total_complete_nodraw" json:"totalCompleteNodraw"`
	TotalCancel         int64 `gorm:"column:total_cancel" json:"totalCancel"`
	TotalCancelNodraw   int64 `gorm:"column:total_cancel_nodraw" json:"totalCancelNodraw"`
	TotalSy             int64 `gorm:"column:total_sy" json:"totalSy"`
	TotalAllDraw        int64 `gorm:"column:total_alldraw" json:"totalAlldraw"`
	TotalDraw           int64 `gorm:"column:total_draw" json:"totalDraw"`
	TotalNodraw         int64 `gorm:"column:total_nodraw" json:"totalNodraw"`
	TotalSmalldraw      int64 `gorm:"column:total_smalldraw" json:"totalSmalldraw"`
	TotalIncome         int64 `gorm:"column:total_income" json:"totalIncome"`

	SettlementTotal        int64 `gorm:"column:settlement_total" json:"settlementTotal"`
	SettlementNormalTotal  int64 `gorm:"column:settlement_normal_total" json:"settlementNormalTotal"`
	SettlementComplete     int64 `gorm:"column:settlement_complete" json:"settlementComplete"`
	SettlementCancel       int64 `gorm:"column:settlement_cancel" json:"settlementCancel"`
	SettlementCancelNodraw int64 `gorm:"column:settlement_cancel_nodraw" json:"settlementCancelNodraw"`
	SettlementAlldraw      int64 `gorm:"column:settlement_alldraw" json:"settlementAlldraw"`
	SettlementDraw         int64 `gorm:"column:settlement_draw" json:"settlementDraw"`
	SettlementNodraw       int64 `gorm:"column:settlement_nodraw" json:"settlementNodraw"`
	SettlementSmalldraw    int64 `gorm:"column:settlement_smalldraw" json:"settlementSmalldraw"`

	BranchPlaces int `gorm:"column:branch_places" json:"branchPlaces"`

	WeixinTotal        int64 `gorm:"column:weixin_total" json:"weixinTotal"`                // 企业付款至零钱  笔数
	WeixinMoney        int64 `gorm:"column:weixin_money" json:"weixinMoney"`                // 企业付款至零钱  金额
	QrcodeTotal        int64 `gorm:"column:qrcode_total" json:"qrcodeTotal"`                // 收款二维码 发起笔数
	QrcodeWaitTotal    int64 `gorm:"column:qrcode_wait_total" json:"qrcodeWaitTotal"`       // 收款二维码 待处理笔数
	QrcodeSuccessTotal int64 `gorm:"column:qrcode_success_total" json:"qrcodeSuccessTotal"` // 收款二维码 已处理笔数
	QrcodeWaitMoney    int64 `gorm:"column:qrcode_wait_money" json:"qrcodeWaitMoney"`       // 收款二维码 待处理金额
	QrcodeSuccessMoney int64 `gorm:"column:qrcode_success_money" json:"qrcodeSuccessMoney"` // 收款二维码 已处理金额
	CashFailedTotal    int64 `gorm:"column:cash_failed_total" json:"cashFailedTotal"`       // 处理失败笔数
	CashFailedMoney    int64 `gorm:"column:cash_failed_money" json:"cashFailedMoney"`       // 处理失败金额
}

type BasicAnalysis struct {
	StatisticsModel
	UpdateTime      string            `gorm:"-" json:"updateTime"`
	NowDate         string            `gorm:"-" json:"nowDate"`
	SettlementChart []SettlementChart `gorm:"-" json:"settlementChart"` // 流水曲线图
	PriceChart      []PriceChart      `gorm:"-" json:"priceChart"`      // 单价曲线图
	SaleChart       []SaleChart       `gorm:"-" json:"saleChart"`       // 动销率曲线图
	SaleRateChart   []SaleRateChart   `gorm:"-" json:"saleRateChart"`   // 动销率曲线图
	IncomeChart     []IncomeChart     `gorm:"-" json:"incomeChart"`     // 收益曲线图
	AdIncomeChart   []AdIncomeChart   `gorm:"-" json:"adIncomeChart"`
	CashChart       []CashChart       `gorm:"-" json:"cashChart"`
	ScanChart       []ScanChart       `gorm:"-" json:"scanChart"`
	ConvRateChart   []ConvRateChart   `gorm:"-" json:"convRateChart"`
	UvChart         []UvChart         `gorm:"-" json:"uvChart"`
}

type BasicAnalysisNormal struct {
	StatisticsModel
	UpdateTime      string             `gorm:"-" json:"updateTime"`
	NowDate         string             `gorm:"-" json:"nowDate"`
	SettlementChart []SettlementNormalChart  `gorm:"-" json:"settlementChart"`   // 流水曲线图
	PriceChart      []PriceChart       `gorm:"-" json:"priceChart"`         // 单价曲线图
	SaleChart       []SaleChart        `gorm:"-" json:"saleChart"`          // 动销率曲线图
}

// 流水曲线图
//[
//{ 时间: xxxx, 总流水: xxx, 微信流水: xxx, 支付宝流水: xxxx, 抽单: xxx },
//{ .....}
//]
type SettlementNormalChart struct {
	DateTime             string  `gorm:"column:date_str" json:"dateStr"`                          // 时间
	SettlementTotal      float64 `gorm:"column:settlement_complete" json:"流水"`          // 总流水
	IncomeBusiness       float64 `gorm:"column:income_business" json:"收益"`        // 运营商收益
}

type SettlementChart struct {
	DateTime            string  `gorm:"column:date_str" json:"dateStr"`           // 时间
	SettlementTotal     float64 `gorm:"column:settlement_total" json:"总流水"`       // 总流水
	WxSettlementTotal   float64 `gorm:"column:wx_settlement_total" json:"微信流水"`   // 微信流水
	ZfbSettlementTotal  float64 `gorm:"column:zfb_settlement_total" json:"支付宝流水"` // 支付宝流水
	DrawSettlementTotal float64 `gorm:"column:draw_settlement_total" json:"抽单流水"` // 抽单总流水
}

type IncomeChart struct {
	DateStr        string  `gorm:"column:date_str" json:"dateStr"`      // 时间
	IncomeTotal    float64 `gorm:"column:income_total" json:"总收益"`      // 总收益
	IncomeBusiness float64 `gorm:"column:income_business" json:"运营商收益"` // 运营商收益
	IncomeBranch   float64 `gorm:"column:income_branch" json:"分公司收益"`   // 分公司收益
	IncomeAd       float64 `gorm:"column:income_ad" json:"广告收益"`        // 广告收益
}

type AdIncomeChart struct {
	DateTime   string  `gorm:"column:date_str" json:"日期"` // 时间
	Money      float64 `gorm:"column:money" json:"广告收益"`
	UvPrice    float64 `gorm:"column:uv_price" json:"单价UV"`
	TotalPrice float64 `gorm:"column:total_price" json:"单价笔数"`
}

// 动销率曲线图
type CashChart struct {
	DateTime string  `gorm:"column:date_str" json:"日期"`
	Total    int     `gorm:"column:total" json:"提现笔数"`
	Money    float64 `gorm:"column:money" json:"提现金额"`
}

// UV
type UvChart struct {
	DateTime string `gorm:"column:date_str" json:"日期"`
	Count    int64  `gorm:"column:count" json:"总UV"`
	WxUv     int64  `gorm:"column:wx_uv" json:"微信UV"`
	ZfbUv    int64  `gorm:"column:zfb_uv" json:"支付宝UV"`
	PvCount  int64  `gorm:"column:pv_count" json:"扫码PV"`
	UvCount  int64  `gorm:"column:uv_count" json:"扫码UV"`
}

// 单价曲线图
//[
//{ 时间: XXX, 笔数：xxx, 单价：xxxx },
//{ 时间: XXX, 笔数：xxx, 单价：xxxx },
//{ 时间: XXX, 笔数：xxx, 单价：xxxx },
//{ 时间: XXX, 笔数：xxx, 单价：xxxx },
//]
type PriceChart struct {
	DateTime   string  `gorm:"column:date_str" json:"日期"`    // 时间
	OrderTotal int     `gorm:"column:order_total" json:"笔数"` // 笔数
	Price      float64 `gorm:"column:price" json:"单价"`       // 单价
}

// 动销曲线图
type SaleChart struct {
	DateTime    string `gorm:"column:date_str" json:"日期"`
	CountPlace  int    `gorm:"column:count_place" json:"门店动销"`
	CountDevice int    `gorm:"column:count_device" json:"设备动销"`
	TotalPlace  int    `gorm:"column:total_place" json:"门店数"`
}

// 动销率曲线图
type SaleRateChart struct {
	DateTime   string  `gorm:"column:date_str" json:"日期"`
	PlaceRate  float64 `gorm:"column:place_rate" json:"门店动销率"`
	DeviceRate float64 `gorm:"column:device_rate" json:"设备动销率"`
}

type ConvRateChart struct {
	DateTime string  `gorm:"column:date_str" json:"日期"` // 时间
	Rate     float64 `gorm:"column:rate" json:"转化率"`    // 转化率
}

type GetChargeDataListRes struct {
	Num       int64  `gorm:"column:num" json:"num"`
	ExtendNum int64  `gorm:"column:e_num" json:"extendNum"`
	Date      string `gorm:"column:date" json:"date"`
}

type GetRoomIncomeMoneyListRes struct {
	TotalIncome int64  `gorm:"column:total_income" json:"totalIncome"`
	Date        string `gorm:"column:date" json:"date"`
}

type GetRoomOrderListRes struct {
	TypeName        string `gorm:"column:type_name" json:"typeName"`
	TypeId          int64  `gorm:"column:type_id" json:"typeId"`
	TotalOrders     int64  `gorm:"column:total_orders" json:"totalOrders"`
	SettlementTotal int64  `gorm:"column:settlement_total" json:"settlementTotal"`
	Date            string `gorm:"column:date" json:"date"`
}

type GetRoomOrderDataRes struct {
	TypeName        string `gorm:"column:type_name" json:"typeName"`
	TypeId          int64  `gorm:"column:type_id" json:"typeId"`
	TotalOrders     int64  `gorm:"column:total_orders" json:"totalOrders"`
	SettlementTotal int64  `gorm:"column:settlement_total" json:"settlementTotal"`
}

type GetRoomDataRes struct {
	TotalOrders     int64  `gorm:"column:total_orders" json:"totalOrders"`
	SettlementTotal int64  `gorm:"column:settlement_total" json:"settlementTotal"`
	TotalIncome     int64  `gorm:"column:total_income" json:"totalIncome"`
	Date            string `gorm:"column:date" json:"date"`
}

type GetGoodsIncomeMoneyListRes struct {
	TotalIncome int64  `gorm:"column:total_income" json:"totalIncome"`
	Date        string `gorm:"column:date" json:"date"`
}

type GetGoodsOrderListRes struct {
	TotalOrders     int64  `gorm:"column:total_orders" json:"totalOrders"`
	SettlementTotal int64  `gorm:"column:settlement_total" json:"settlementTotal"`
	TotalIncome     int64  `gorm:"column:total_income" json:"totalIncome"`
	Date            string `gorm:"column:date" json:"date"`
}

type GetGoodsDataRes struct {
	TotalGoods      int64  `gorm:"column:total_goods" json:"totalGoods"`
	TotalOrders     int64  `gorm:"column:total_orders" json:"totalOrders"`
	SettlementTotal int64  `gorm:"column:settlement_total" json:"settlementTotal"`
	TotalIncome     int64  `gorm:"column:total_income" json:"totalIncome"`
	Date            string `gorm:"column:date" json:"date"`
}

type GetAutomateIncomeMoneyListRes struct {
	TotalIncome int64  `gorm:"column:total_income" json:"totalIncome"`
	Date        string `gorm:"column:date" json:"date"`
}

type GetAutomateOrderGoodsListRes struct {
	GoodsId         int    `gorm:"column:automate_good_id" json:"goodsId"`
	GoodsName       string `gorm:"column:goods_name" json:"goodsName"`
	TotalOrders     int64  `gorm:"column:total_orders" json:"totalOrders"`
	SettlementTotal int64  `gorm:"column:settlement_total" json:"settlementTotal"`
	TotalIncome     int64  `gorm:"column:total_income" json:"totalIncome"`
	Date            string `gorm:"column:date" json:"date"`
}

type GetAutomateOrderGoodsDataRes struct {
	GoodsId         int    `gorm:"column:automate_good_id" json:"goodsId"`
	GoodsName       string `gorm:"column:goods_name" json:"goodsName"`
	TotalOrders     int64  `gorm:"column:total_orders" json:"totalOrders"`
	SettlementTotal int64  `gorm:"column:settlement_total" json:"settlementTotal"`
}

type GetAutomateDataRes struct {
	TotalGoods      int64  `gorm:"column:total_goods" json:"totalGoods"`
	TotalDevices    int64  `gorm:"column:total_devices" json:"totalDevices"`
	TotalOrders     int64  `gorm:"column:total_orders" json:"totalOrders"`
	SettlementTotal int64  `gorm:"column:settlement_total" json:"settlementTotal"`
	TotalIncome     int64  `gorm:"column:total_income" json:"totalIncome"`
	Date            string `gorm:"column:date" json:"date"`
}

type GetGetChargeDataRes struct {
	TotalPlace      int    `gorm:"column:total_place" json:"totalPlace"`
	TotalDevices    int64  `gorm:"column:total_devices" json:"totalDevices"`
	TotalOrders     int64  `gorm:"column:total_orders" json:"totalOrders"`
	SettlementTotal int64  `gorm:"column:settlement_total" json:"settlementTotal"`
	TotalIncome     int64  `gorm:"column:total_income" json:"totalIncome"`
	TotalCancel     int64  `gorm:"column:total_cancel" json:"totalCancel"`
	Date            string `gorm:"column:date" json:"date"`
}

type StatisticsUserList struct {
	StatisticsUserModel
	IsAdmin  uint8  `gorm:"column:is_admin" json:"isAdmin"` // 1管理员 2:运营商 3:代理商 4:商户 5:员工
	Name     string `gorm:"column:name" json:"name"`
	UserName string `gorm:"column:user_name" json:"userName"`
	Phone    string `gorm:"column:phone" json:"phone"`
	UserNo   string `gorm:"column:user_no" json:"userNo"`

	Province string `gorm:"column:province" json:"province"` // 用户所在省份
	City     string `gorm:"column:city" json:"city"`         // 用户所在城市
}

type StatisticsUserTeamRankList struct {
	UserId   int64  `gorm:"column:user_id" json:"userId"`
	Name     string `gorm:"column:name" json:"name"`
	UserName string `gorm:"column:user_name" json:"userName"`
	Phone    string `gorm:"column:phone" json:"phone"`

	TotalTeam       int `gorm:"column:total_team" json:"totalTeam"`
	TotalDirectTeam int `gorm:"column:total_direct_team" json:"totalDirectTeam"`
}

type StatisticsUserPlaceRankList struct {
	UserId   int64  `gorm:"column:user_id" json:"userId"`
	Name     string `gorm:"column:name" json:"name"`
	UserName string `gorm:"column:user_name" json:"userName"`
	Phone    string `gorm:"column:phone" json:"phone"`

	TotalPlace       int `gorm:"column:total_place" json:"totalPlace"`
	TotalDirectPlace int `gorm:"column:total_direct_place" json:"totalDirectPlace"`
}

type StatisticsUserSettlementRankList struct {
	UserId   int64  `gorm:"column:user_id" json:"userId"`
	Name     string `gorm:"column:name" json:"name"`
	UserName string `gorm:"column:user_name" json:"userName"`
	Phone    string `gorm:"column:phone" json:"phone"`

	SettlementTotal     int64 `gorm:"column:settlement_total" json:"settlementTotal"`
	SettlementDraw      int64 `gorm:"column:settlement_draw" json:"settlementDraw"`
	SettlementNodraw    int64 `gorm:"column:settlement_nodraw" json:"settlementNodraw"`
	SettlementSmalldraw int64 `gorm:"column:settlement_smalldraw" json:"settlementSmalldraw"`
}

type StatisticsUserIncomeRankList struct {
	UserId   int64  `gorm:"column:user_id" json:"userId"`
	Name     string `gorm:"column:name" json:"name"`
	UserName string `gorm:"column:user_name" json:"userName"`
	Phone    string `gorm:"column:phone" json:"phone"`

	IncomeTotal int64 `gorm:"column:total_income" json:"totalIncome"`
}

type ScanChart struct {
	DateTime string `gorm:"column:date_str" json:"日期"` // 时间
	PvCount  int64  `gorm:"column:pv_count" json:"扫码数"`
	UvCount  int64  `gorm:"column:uv_count" json:"扫码用户数"`
}

type UserAnalysisModel struct {
	ID      int    `gorm:"column:id" json:"id"`            //
	DateStr string `gorm:"column:date_str" json:"dateStr"` // 日期
	UserId  int64  `gorm:"column:user_id" json:"userId"`

	// 总订单笔数
	TotalComplete int64 `gorm:"column:total_complete" json:"totalComplete"`
	// 未抽单订单笔数
	TotalCompleteNodraw int64 `gorm:"column:total_complete_nodraw" json:"totalCompleteNodraw"`
	// 抽单订单笔数
	TotalDraw int64 `gorm:"column:total_draw" json:"totalDraw"`

	// 总流水
	SettlementComplete float64 `gorm:"column:settlement_complete" json:"settlementComplete"`
	// 抽单流水
	SettlementDraw float64 `gorm:"column:settlement_draw" json:"settlementDraw"`
	// 未抽单流水
	SettlementNormalTotal float64 `gorm:"column:settlement_normal_total" json:"settlementNormalTotal"`
	// 收益
	TotalIncome float64 `gorm:"column:total_income" json:"totalIncome"`

	TotalPlace int64 `gorm:"column:total_place" json:"totalPlace"` // 门店数
	PlaceSales int64 `gorm:"column:place_sale" json:"placeSales"`  // 门店动销数

	TotalDevices int64 `gorm:"column:total_devices" json:"totalDevices"` // 设备数
}

type UserAnalysisInfo struct {
	DateStr string `gorm:"column:date_str" json:"dateStr"` // 日期

	TotalComplete      int64   `gorm:"column:total_complete" json:"totalComplete"`           // 总订单笔数
	SettlementComplete float64 `gorm:"column:settlement_complete" json:"settlementComplete"` // 总流水
	TotalIncome        float64 `gorm:"column:total_income" json:"totalIncome"`               // 收益

	TotalPlace   int64 `gorm:"column:total_place" json:"totalPlace"` // 门店数
	TotalDevices int64 `gorm:"column:total_devices" json:"totalDevices"`

	DividMoney string `gorm:"-" json:"dividMoney"` // 累计收益
	CashMoney  string `gorm:"-" json:"cashMoney"`  // 已提现金额
	Money      string `gorm:"-" json:"money"`      // 用户余额（可提现金额）

	UpdateTime string `gorm:"-" json:"updateTime"` // 更新时间
	NowDate    string `gorm:"-" json:"nowDate"`    // 当前时间
}

type UserAnalysis struct {
	UpdateTime        string               `gorm:"-" json:"updateTime"`        // 更新时间
	NowDate           string               `gorm:"-" json:"nowDate"`           // 当前时间
	UserAnalysisModel *UserAnalysisModel   `gorm:"-" json:"userAnalysisModel"` // 用户基础数据
	UserDayAnalysis   []*UserAnalysisModel `gorm:"-" json:"userDayAnalysis"`   // 用户天数据
	UserMonthAnalysis []*UserAnalysisModel `gorm:"-" json:"userMonthAnalysis"` // 用户月数据
}

// 折线图 样例
//categories: ["2016","2017","2018","2019","2020","2021"],
//series: [
// {
//  name: "成交量A",
//  data: [35,8,25,37,4,20]
// },
// {
//  name: "成交量B",
//  data: [70,40,65,100,44,68]
// },
// {
//  name: "成交量C",
//  data: [100,80,95,150,112,132]
// }
//]

type UserStatisticData struct {
	Categories []string  `gorm:"-" json:"categories"`
	Series     []*Series `gorm:"-" json:"series"`
}

type Series struct {
	Name  string    `gorm:"-" json:"name"`
	Type  string    `gorm:"-" json:"type"`
	Data  []float64 `gorm:"-" json:"data"`
	Index int       `gorm:"-" json:"index"`
}

type StatisticsUserRankList struct {
	UserId   int64  `gorm:"column:user_id" json:"userId"`
	Name     string `gorm:"column:name" json:"name"`
	UserName string `gorm:"column:user_name" json:"userName"`
	Phone    string `gorm:"column:phone" json:"phone"`
	Province string `gorm:"column:province" json:"province"` // 用户所在省份
	City     string `gorm:"column:city" json:"city"`         // 用户所在城市

	TotalTeam       int `gorm:"column:total_team" json:"totalTeam"`
	TotalDirectTeam int `gorm:"column:total_direct_team" json:"totalDirectTeam"`

	TotalPlace       int `gorm:"column:total_place" json:"totalPlace"`
	TotalDirectPlace int `gorm:"column:total_direct_place" json:"totalDirectPlace"`

	SettlementTotal     int64 `gorm:"column:settlement_total" json:"settlementTotal"`
	SettlementDraw      int64 `gorm:"column:settlement_draw" json:"settlementDraw"`
	SettlementNodraw    int64 `gorm:"column:settlement_nodraw" json:"settlementNodraw"`
	SettlementSmalldraw int64 `gorm:"column:settlement_smalldraw" json:"settlementSmalldraw"`

	IncomeTotal int64 `gorm:"column:total_income" json:"totalIncome"`
}

type UserSettlementChart struct {
	DateTime string `gorm:"column:date_str" json:"dateStr"` // 时间
	//SettlementTotal      float64 `gorm:"column:settlement_total" json:"总流水"`          // 总流水
	SettlementComplete  float64 `gorm:"column:settlement_complete" json:"总流水"`    // 总流水
	DrawSettlementTotal float64 `gorm:"column:draw_settlement_total" json:"抽单流水"` // 抽单总流水
}
